package Basics;
import vecmath.Tuple3d;

public class my3DPoint extends Tuple3d{ 
	
	public my3DPoint () {	
		super();
	}
	
	public my3DPoint(double[] arrayOfCoordinates) {
		super(arrayOfCoordinates);
	}
	
	public my3DPoint (double x, double y, double z) {
		super(x,y,z);
	}
	
	public my3DPoint (my3DPoint p) {
		super(p);
	}
	

	
	public my3DPoint addToPoint(Tuple3d pointOrVector) {
		
		this.x = this.x+ pointOrVector.getX();
		this.y = this.y+ pointOrVector.getY();
		this.z = this.z+pointOrVector.getZ();
		return this;
	
	}
	
	public my3DPoint ScalePoint(int ScaleFactor) {
		this.x = this.x*ScaleFactor;
		this.y = this.y*ScaleFactor;
		this.z = this.z*ScaleFactor;
		return this;
	}
	
	public double Distance (my3DPoint point) {
		return Math.sqrt(Math.pow(this.x-point.getX(), 2) + Math.pow(this.y-point.getY(), 2) + Math.pow(this.z-point.getZ(), 2));
		
	}
	
	public boolean isCollinearTo (my3DPoint p1, my3DPoint p2) {
		myVector vec1 = new myVector(this, p1);
		myVector vec2 = new myVector(this, p2);
		return vec1.isCollinearTo(vec2);
		
	}
	
	
	

	
	

}
